#include <iostream>
#include <string>
#include "PL3_worker.h"

using std::cout;
using std::endl;
using std::cin;

Worker::~Worker(){}

void Worker::set()
{
    cout << "Enter a name: ";
    getline (cin,fullname_);
    cout << "Enter a id: ";
    cin >> id_;
}

void Worker::show() const
{
    cout <<"["<< this<<"]: " << "name=" << fullname_ 
         <<", id=" << id_;
}

void Waiter::set()
{
    cout <<this->type()<<" set:";
    Worker::set();
    cout << "Enter "<< this->type() <<" panache: ";
    cin >> panache;
    while (cin.get() != '\n')
    {
        continue;
    }
}

void Waiter::show() const
{
    cout<<"Waiter";
    Worker::show();
    cout << ", panache=" << panache << endl;
}
const char * Singer::pv[]={"other","alto","contralto","soprano","bass","baritone","tenor"};

void Singer::set()
{
    cout <<this->type()<<" set ";
    Worker::set();
    cout << "Enter "<< this->type() <<" voice: 0=other,1=alto,2=contralto,3=soprano,4=bass,5=baritone,6=tenor\n";
    cin >> voice;
    while (voice < 0 or voice >= Vtypes)
    {
        cout << "Enter "<< this->type() <<" voice: 0=other,1=alto,2=contralto,3=soprano,4=bass,5=baritone,6=tenor\n";
        cin >> voice;
    }
    while (cin.get() != '\n')
    {
        continue;
    }
}

void Singer::show() const
{
    cout<<"Singer";
    Worker::show();
    cout << ", voice=" << pv[voice] << endl;
}
